package com.base.invoke.exception;

/**
 * 统一业务异常
 * @author coolpig
 * @date 2020-11-10
 */
public class BizException extends RuntimeException {

    private static final long serialVersionUID = -4675545954466532022L;
    /**
     * code     返回码
     * msg      返回码描述
     * subCode  详细返回码
     * subMsg   详细返回码描述
     */
    protected int code;
    protected String msg;
    protected String subCode;
    protected String subMsg;

    public BizException(int code,String msg){
        this.code = code;
        this.msg = msg;
    }

    public BizException(String subCode, String subMsg) {
        super(subMsg);
        this.subCode = subCode;
        this.subMsg = subMsg;
    }

    public BizException(int code,String msg,String subCode,String subMsg){
        this.code = code;
        this.msg = msg;
        this.subCode = subCode;
        this.subMsg = subMsg;
    }

    public BizException() {
        super();
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getSubCode() {
        return subCode;
    }

    public void setSubCode(String subCode) {
        this.subCode = subCode;
    }

    public String getSubMsg() {
        return subMsg;
    }

    public void setSubMsg(String subMsg) {
        this.subMsg = subMsg;
    }
}
